package com.bbf.db.multiple.service;

import com.bbf.db.multiple.dao.read.QdComputerReadDao;
import com.bbf.db.multiple.dao.write.QdComputerWriteDao;
import com.bbf.db.multiple.entity.QdComputerEntity;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class QdComputerServiceImpl implements QdComputerService {

  @Resource
  private QdComputerReadDao qdComputerReadDao;
  @Resource
  private QdComputerWriteDao qdComputerWriteDao;

  @Override
  public QdComputerEntity findById(String id) {
    return qdComputerReadDao.selectByPrimaryKey(id);
  }

  @Override
  public int deleteById(String id) {
    return qdComputerWriteDao.deleteByPrimaryKey(id);
  }

  @Override
  public int insertOne(QdComputerEntity model) {
    return qdComputerWriteDao.insertSelective(model);
  }

  @Override
  public int updateOne(QdComputerEntity model) {
    return qdComputerWriteDao.updateByPrimaryKeySelective(model);
  }
}
